package com.yvon.maple.service.auth.param;

import com.yvon.maple.service.auth.vo.CaptchaVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;

/**
 * @author : Yvon
 * @since : 2021-08-23
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Builder
@ApiModel(value = "LoginParamDTO", description = "登录参数")
public class LoginParam implements Serializable {

    /**
     * 短信、邮件验证码
     */
    @ApiModelProperty(value = "短信、邮件验证码")
    private String code;


    @ApiModelProperty(value = "账号")
    private String username;


    @ApiModelProperty(value = "密码")
    private String password;

    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号")
    private String mobile;

    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱")
    private String email;

    /**
     * password: 账号密码
     * refresh_token: 刷新token
     */
    @ApiModelProperty(value = "授权类型", example = "password", allowableValues = "refresh_token,password,sms,email")
    @NotEmpty(message = "授权类型不能为空")
    private String grantType;

    /**
     * 前端界面点击清空缓存时调用
     */
    @ApiModelProperty(value = "刷新token")
    private String refreshToken;

    /**
     * 验证码
     */
    @ApiModelProperty(value = "验证码")
    private CaptchaVo captcha;
}
